    <div class="nav-sub w1180">
    	<ul class="zoom">
    		<li><a class="on" href="/crm/recharge/index">储值卡管理</a></li>
    	</ul>
    </div>
    	<div class="main-ct w1180">
<!-- 		<a href="/crm/recharge" class="btn-cs btn-blue btn-fillet mt10">返 回</a> -->

		<div class="Tcols clear">
			<div class="fl form-info mt20" style="width:500px ">
				<form id="form1" method="post" action="/crm/recharge/save">
				<input name="rc_id" id="rc_id" type="hidden" value="<?php echo $this->rc_id;?>">
				<dl>
					<dt>名称：</dt>
					<dd><input name="name" id="name"  type="text" class="txt txt-ss" value="<?php echo isset($this->rechargeCard['rc_name'])?$this->rechargeCard['rc_name']:'';?>"></dd>
				</dl>
				<dl>
					<dt>额 度：</dt>
					<dd><input name="amount" id="amount"  type="text" class="txt txt-ss" value="<?php echo isset($this->rechargeCard['rc_amount'])?$this->rechargeCard['rc_amount']:'';?>"></dd>
				</dl>
				<dl>
					<dt>数 量：</dt>
					<dd><input name="num" id="num" type="text" class="txt txt-ss" <?php if($this->rc_id != ''):?> readonly="readonly" <?php endif;?> value="<?php echo isset($this->rechargeCard['rc_num'])?$this->rechargeCard['rc_num']:'';?>"></dd>
				</dl>
				<dl>
					<dt>开始日期：</dt>
					<dd><input name="start_time" id="start_time" type="text" class="txt txt-ss" onFocus="WdatePicker({isShowClear:false,readOnly:true})" value="<?php echo isset($this->rechargeCard['rc_start_time'])?$this->rechargeCard['rc_start_time']:'';?>"></dd>
				</dl>
				<dl>
					<dt>截止日期：</dt>
					<dd><input name="end_time" id="end_time" type="text" class="txt txt-ss" onFocus="WdatePicker({isShowClear:false,readOnly:true})" value="<?php echo isset($this->rechargeCard['rc_end_time'])?$this->rechargeCard['rc_end_time']:'';?>"></dd>
				</dl>
        		<dl>
        			<dt>备注：</dt>
        			<dd><input name="remark" id="remark" type="text" class="txt txt-ss" value="<?php echo isset($this->rechargeCard['rc_remark'])?$this->rechargeCard['rc_remark']:'';?>"></dd>
        		</dl>
				<dl>
					<dt>&nbsp;</dt>
					<dd>
						<input style="padding:5px;" class="input-cs btn-cs btn-yel mr10" type="submit" value="<?php echo $this->rc_id == ''? '生成' : '保存';?>">
						<?php if($this->rc_id != ''):?><a href="/crm/recharge/excel-detail/<?php echo $this->rc_id;?>" class="btn-cs btn-green" >输出报表</a><?php endif;?>
					</dd>
				</dl>
				</form>
			</div>
			<?php if($this->rc_id != ''):?>
			<div class="fr list-fr">
				<h1 class="tit-r">储值卡列表</h1>
				<div class="row" id="list_table">
				</div>
			</div>
			<?php endif;?>
		</div>

	</div>
<script src="/plugins/My97DatePicker/WdatePicker.js"></script>
<script>
$().ready(function() {
	$("#form1").validate({
		debug:true,
		rules: {
			name: {
				required: true,
			},
			amount: {
				required: true,
			},
			num: {
				required: true,
			},
			start_time: {
				required: true,
				dateISO: true,
			},
			end_time: {
				required: true,
				dateISO: true,
			},
	
		},
		submitHandler:function(form){  
            form.submit();
	    }
	});

});

<?php if($this->rc_id != ''):?>
var page;

$(document).ready(function(){
	ajaxListTable();
});

function search(){
	page = 0;

	ajaxListTable();
}

function ajaxListTable(){
	$.ajax({
        type: "post",
        url : "<?php echo $this->url('crm/recharge',
            array('action'=>'ajax-recharge-list'));?>",
        dataType:'html',
        data:  { 
            "rc_id": '<?php echo $this->rechargeCard["rc_id"];?>', 
			"page":page },
        cache: false,
        timeout:10000, 
        error: function(){
          	 alert('请求超时，请重新操作');
           	 isPost = false;
             return false; 
         }, 
        success: function(html){
        	$("#list_table").html(html);
        }
    });
}
<?php endif;?>
</script>
